package com.example.demo.service;

import com.example.demo.dao.DepartmentDao;
import com.example.demo.domain.Department;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service("departmentService")
public class DepartmentService {
    @Autowired
    DepartmentDao departmentDao;
    //增加
    public List<Department> addDepartment(Department department){
        return departmentDao.addDepartment(department);
    }
    public List<Department> addDepartments(List<Department> departments){
        return departmentDao.addDepartments(departments);
    }
    //查询
    public List<Department> getAll(){
        return departmentDao.getAll();
    }
    public Department getOneByNo(String no){
        return departmentDao.getOneByNo(no);
    }
}
